package com.hand.qt24953.order.api.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.choerodon.mybatis.domain.AuditDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hzero.boot.platform.lov.annotation.LovValue;
import org.hzero.core.base.BaseConstants;
import org.hzero.export.annotation.ExcelColumn;
import org.hzero.export.annotation.ExcelSheet;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author qiutao 2019/8/3 16:10
 */
@ApiModel("订单数据")
@ExcelSheet(zh = "销售订单", en = "Order record")
public class OrderDTO extends AuditDomain {
    @ApiModelProperty("订单头ID")
    private Long soHeaderId;
    @ApiModelProperty("销售订单号")
    @ExcelColumn(zh = "销售订单号", en = "order_number", showInChildren = true)
    private String orderNumber;
    @ApiModelProperty("公司名称")
    @ExcelColumn(zh = "公司名称", en = "company_name")
    private String companyName;
    @ApiModelProperty("客户名称")
    @ExcelColumn(zh = "客户名称", en = "customer_name")
    private String customerName;
    @ApiModelProperty("订单日期")
    @ExcelColumn(zh = "订单日期", en = "order_date", pattern = BaseConstants.Pattern.DATE)
    private Date orderDate;
    @ApiModelProperty("订单状态")
    @LovValue(lovCode = "HZERO.ORDER.STATUS")
    private String orderStatus;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(hidden = true)
    @ExcelColumn(zh = "订单状态", en = "order_status")
    private String orderStatusMeaning;
    @ApiModelProperty("订单金额")
    @ExcelColumn(zh = "订单金额", en = "order_amount", pattern = BaseConstants.Pattern.TB_TWO_DECIMAL)
    private BigDecimal orderAmount;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty("订单行列表")
    @ExcelColumn(zh = "订单行列表", en = "lines", child = true)
    private List<OrderLineDTO> lines;

    @Override
    public String toString() {
        return "OrderDTO{" +
                "soHeaderId='" + soHeaderId + '\'' +
                "orderNumber='" + orderNumber + '\'' +
                ", companyName='" + companyName + '\'' +
                ", customerName='" + customerName + '\'' +
                ", orderDate=" + orderDate +
                ", orderStatus='" + orderStatus + '\'' +
                ", orderStatusMeaning='" + orderStatusMeaning + '\'' +
                ", orderAmount=" + orderAmount +
                ", lines=" + lines +
                '}';
    }

    public Long getSoHeaderId() {
        return soHeaderId;
    }

    public void setSoHeaderId(Long soHeaderId) {
        this.soHeaderId = soHeaderId;
    }

    public String getOrderStatusMeaning() {
        return orderStatusMeaning;
    }

    public OrderDTO setOrderStatusMeaning(String orderStatusMeaning) {
        this.orderStatusMeaning = orderStatusMeaning;
        return this;
    }

    public List<OrderLineDTO> getLines() {
        return lines;
    }

    public OrderDTO setLines(List<OrderLineDTO> lines) {
        this.lines = lines;
        return this;
    }

    public String getOrderNumber() {
        return orderNumber;
    }

    public OrderDTO setOrderNumber(String orderNumber) {
        this.orderNumber = orderNumber;
        return this;
    }

    public String getCompanyName() {
        return companyName;
    }

    public OrderDTO setCompanyName(String companyName) {
        this.companyName = companyName;
        return this;
    }

    public String getCustomerName() {
        return customerName;
    }

    public OrderDTO setCustomerName(String customerName) {
        this.customerName = customerName;
        return this;
    }

    public Date getOrderDate() {
        return orderDate;
    }

    public OrderDTO setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
        return this;
    }

    public String getOrderStatus() {
        return orderStatus;
    }

    public OrderDTO setOrderStatus(String orderStatus) {
        this.orderStatus = orderStatus;
        return this;
    }

    public BigDecimal getOrderAmount() {
        return orderAmount;
    }

    public OrderDTO setOrderAmount(BigDecimal orderAmount) {
        this.orderAmount = orderAmount;
        return this;
    }
}
